<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    window.onload = function() {
      var students = [{
        name:'张三',
        age:1,
        gender:'男'
      },{
        name:'李四',
        age:1,
        gender:'男'
      },{
        name:'王五',
        age:1,
        gender:'男'
      },{
        name:'路人甲',
        age:1,
        gender:'男'
      }];
      // 获取tbody节点
      var tbody = document.getElementsByTagName('tbody')[0]
      // 遍历数组
      students.forEach(function(item) {
        // 创建tr节点
        var tr = document.createElement('tr')
        tr.innerHTML = `
          <td>`+item.name+`</td>
          <td>`+item.age+`</td>
          <td>`+item.gender+`</td>
        `
        tbody.appendChild(tr)
      })
    }
  </script>
</head>
<body>
  <div>
    <table>
      <thead>
        <th>姓名</th>
        <th>年龄</th>
        <th>性别</th>
      </thead>
      <tbody>
        
      </tbody>
    </table>
  </div>
</body>
</html>